/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package edu.upf.grupE.DDBB;

import java.text.NumberFormat;

/**
 *
 * @author Fernando Lavilla
 */
public class SearchUtil {

    double latitude, longitude, latitudeNorth, latitudeSouth,
            longitudeNorth, longitudeSouth, radio;

    /**
     *
     * @param latitude
     * @param longitude
     * @param radio
     */
    public SearchUtil(double latitude, double longitude, double radio){
        this.latitude=latitude;
        this.latitude=latitude;
        this.radio=radio;
    }

    /**
     *
     * @param radio
     */
    public void getlongitude(double radio){
        
    }

    /**
     *
     * @param radio
     */
    public void getLatitude(double radio){
        latitudeNorth=latitude+(radio/111180);
        latitudeSouth=latitude-(radio/111180);

        if(latitudeNorth<0){
            latitudeNorth=360+latitudeNorth;
        } else if(latitudeSouth<0){
            latitudeSouth=360+latitudeSouth;
        } else if(latitudeNorth>360){
            latitudeNorth=360-latitudeNorth;
        } else if(latitudeSouth>360){
            latitudeSouth=360-latitudeSouth;
        }

        //Math.floor

        /*
        NumberFormat nf=NumberFormat.getInstance();
        NumberFormat nf2=NumberFormat.getInstance();
        nf.setMaximumFractionDigits(0);
        nf2.setMaximumFractionDigits(0);
        latitudeNorth=Double.parseDouble(nf.format(latitudeNorth));
        latitudeSouth=Double.parseDouble(nf2.format(latitudeSouth));
         */
    }



}
